<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%@taglib uri="/struts-tags" prefix="s"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>My JSP 'Cashierzs.jsp' starting page</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

<script type="text/javascript" src="H-ui.admin/lib/html5shiv.js"></script>
<script type="text/javascript" src="H-ui.admin/lib/respond.min.js"></script>
<link rel="stylesheet" type="text/css" href="H-ui.admin/static/h-ui/css/H-ui.min.css">
<link rel="stylesheet" type="text/css" href="H-ui.admin/static/h-ui.admin/css/H-ui.admin.css">
<link rel="stylesheet" type="text/css" href="H-ui.admin/lib/Hui-iconfont/1.0.8/iconfont.css">
<link rel="stylesheet" type="text/css" href="H-ui.admin/static/h-ui.admin/skin/default/skin.css" id="skin">
<link rel="stylesheet" type="text/css" href="H-ui.admin/static/h-ui.admin/css/style.css">

<script type="text/javascript" src="H-ui.admin/lib/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>
	DD_belatedPNG.fix('*');
	
</script>
  </head>
  
  <body>
  <article class="page-container"><nav class="breadcrumb">
	<i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span>
	收银管理 <span class="c-gray en">&gt;</span> 结账 <a
		class="btn btn-success radius r"
		style="line-height:1.6em;margin-top:3px"
		href="javascript:location.replace(location.href);" title="刷新"><i
		class="Hui-iconfont">&#xe68f;</i> </a></nav>
   <div class="mt-20">
			<table
				class="table table-border table-bordered table-hover table-bg table-sort">
				<thead>
					<tr class="text-c" role="row">
						<th width="80" class="sorting_desc"
							aria-controls="DataTables_Table_0" rowspan="1" colspan="1"
							aria-sort="descending" style="width: 150px;">客户手牌</th>
						<th width="60" class="sorting" aria-controls="DataTables_Table_0"
							rowspan="1" colspan="1" style="width: 150px;">消费金额</th>
					</tr>
				</thead>
				<tbody>
					<s:iterator value="listsp"  var="pjt" id="pjt">
						<tr class="text-c odd" role="row">
							<td class="sorting_1">
							<s:property value="#pjt.sywProject.name" /></td>
							<td class="td-status"><span
								class="label label-success radius">
								<s:property value="#pjt.sywProject.price" /> </span></td>
						</tr>
						</s:iterator>
					</tbody>
					</table>
					<br>
					<s:if test='num == "1" ' >
					<div style="text-align: center;">
					<div class="row cl">
					<label class="label label-success radius">应付金额:&nbsp;&nbsp;</label>
					<input type="text" id="price" value="<s:property value="cashier.price"/>" readonly="readonly">
					</div>
					<div class="row cl">
					<label class="label label-success radius">实付金额:&nbsp;&nbsp;</label>
					<input type="text" name="sfje" id="sfje" ></div>
					<div id="error" style="color:red;"></div>
					<div class="row cl">
					<label class="label label-success radius">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;找零:&nbsp;&nbsp;</label>
					<span><input type="text" name="zl" id="zl" readonly="readonly"></span></div>
					<a id="jza" class="btn btn-primary radius" href="cashierActionupdatecust.action?cashier.handsID=<s:property value="#pjt.sywCustomer.sywHands.id" />&cashier.price=<s:property value="cashier.price" />">
		结账</a>
					</div>
					</s:if>
		</div>
		</article>
	
<!--_footer 作为公共模版分离出去-->
<script type="text/javascript" src="H-ui.admin/lib/jquery/1.9.1/jquery.min.js"></script> 
<script type="text/javascript" src="H-ui.admin/lib/layer/2.4/layer.js"></script>
<script type="text/javascript" src="H-ui.admin/static/h-ui/js/H-ui.min.js"></script> 
<script type="text/javascript" src="H-ui.admin/static/h-ui.admin/js/H-ui.admin.js"></script>
<!--/_footer 作为公共模版分离出去-->

<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="H-ui.admin/lib/My97DatePicker/4.8/WdatePicker.js"></script> 
<script type="text/javascript" src="H-ui.admin/lib/datatables/1.10.0/jquery.dataTables.min.js"></script> 
<script type="text/javascript" src="H-ui.admin/lib/laypage/1.2/laypage.js"></script>
	<script type="text/javascript">
		$(function(){
		var price =	Number($("#price").val());
			$("#sfje").blur(function(){
			var sfje  =	Number($("#sfje").val());
			if(price!=0&&sfje>price){
				var a = sfje-price;
				$("#zl").val(a);
				$("#error").html("");
			}else{
			$("#zl").val("");
				$("#error").html("金额不足");
			}
			});
		/* $("#jza").click(function(){
			var sfje  =	Number($("#sfje").val());
			if(price!=0&&sfje>price){
				
			}
		}); */
		});
		
	</script>
  </body>
</html>
